home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-02 / vdl020d.zip / VFOS.DOC < prev    next >
Text File  |  1993-04-14  |  9KB  |  236 lines

  1. {
  2.  ════════════════════════════════════════════════════════════════════════════
  3.  
  4.  Visionix Serial Communictions Unit - FOSSIL specification (VFOS)
  5.    Version 0.1 - Revision C
  6.  Copyright 1991,92,93 Visionix
  7.  ALL RIGHTS RESERVED
  8.  
  9.  ────────────────────────────────────────────────────────────────────────────
  10.  
  11.  ** revision history in reverse chronological order **
  12.  
  13.  Initials  Date      Comment
  14.  ────────  ────────  ────────────────────────────────────────────────────────
  15.  
  16.  mep       02/11/93  Cleaned up code for beta release
  17.                      Fixed for DPMI mode
  18.  
  19.  jrt       02/08/93  Sync with beta 0.12 release
  20.  
  21.  mep       01/31/93  Bug fixes.
  22.  
  23.  jrt       12/07/92  Sync with beta 0.11 release
  24.  
  25.  jrt       11/21/92  Sync with beta 0.08
  26.  
  27.  
  28.  mep       11/18/92  Code re-implemented to work with VSer.  Major changes
  29.                      completed.  Second internal revision.
  30.  
  31.  mep       11/02/92  First logged revision.
  32.  
  33.  ────────────────────────────────────────────────────────────────────────────
  34. }
  35.  
  36. Unit VFos;
  37.  
  38.  
  39. Uses
  40.  
  41.   VTypes,
  42.   VSerLow,
  43.   DOS;
  44.  
  45. {────────────────────────────────────────────────────────────────────────────}
  46.  
  47. Const
  48.  
  49.   {---------------}
  50.   { FOSSIL Errors }
  51.   {---------------}
  52.  
  53.   ferr_None       = 0;
  54.   ferr_BadCopy    = 1;
  55.  
  56.   {--------------}
  57.   { Miscellanous }
  58.   {--------------}
  59.  
  60.   sfct_None       = 0;
  61.   sfct_RtsCts     = 1;
  62.   sfct_XonXoff    = 2;
  63.  
  64. Type
  65.  
  66.   TFosStruct  = RECORD
  67.  
  68.     StrSiz    : WORD;      { Size of this structure in bytes                 }
  69.     MajVer    : BYTE;      { FOSSIL specificiation revision                  }
  70.     MinVer    : BYTE;      { Revision of this driver                         }
  71.     IDent     : POINTER;   { Far-pointer to ASCIIZ driver description        }
  72.     IBufSize  : WORD;      { Byte size of the receive buffer                 }
  73.     IFree     : WORD;      { Number of buffered (received) bytes             }
  74.     OBufSize  : WORD;      { Byte size of the transmit buffer                }
  75.     OFree     : WORD;      { Number of buffered (transmit) bytes             }
  76.     SWidth    : BYTE;      { Width of display screen                         }
  77.     SHeight   : BYTE;      { Height of display screen                        }
  78.     Baud      : BYTE;      { Baud rate, computer to modem                    }
  79.  
  80.   End;
  81.  
  82.   {---}
  83.  
  84.   PFosIData   = ^TFosIData;
  85.   TFosIData   = RECORD
  86.  
  87.     ComPort   : BYTE;      { Communications port                             }
  88.     BaudRate  : LONGINT;   { Bits per second rate                            }
  89.     Parity    : CHAR;      { Parity of hardware error checking               }
  90.     DataBits  : BYTE;      { Number of data bits                             }
  91.     StopBits  : BYTE;      { Number of stop bits                             }
  92.     PortStat  : WORD;      { Condition of UART. LoByte=MSR,HiByte=LSR        }
  93.     UsingX00  : BOOLEAN;   { True if using X00 FOSSIL                        }
  94.     Sig       : WORD;      { $1954 if FOSSIL installed                       }
  95.  
  96.     FosStruct : TFosStruct;
  97.  
  98.   END;
  99.  
  100. {────────────────────────────────────────────────────────────────────────────}
  101.  
  102. Procedure VFosSetCommParam(            ComPort      : LONGINT;
  103.                                        BaudRate     : WORD;
  104.                                        Parity       : CHAR;
  105.                                        DataBits     : BYTE;
  106.                                        StopBits     : BYTE;
  107.                                    Var PortStat     : WORD     );
  108.  
  109. Procedure VFosSendCharW(               ComPort      : WORD;
  110.                                        Ch           : CHAR;
  111.                                    Var PortStat     : WORD     );
  112.  
  113. Procedure VFosRecvCharW(               ComPort      : WORD;
  114.                                    Var Ch           : CHAR;
  115.                                    Var PortStat     : WORD     );
  116.  
  117. Function  VFosGetChar(                 ComPort      : WORD     ) : CHAR;
  118.  
  119. Procedure VFosGetPortStat(             ComPort      : WORD;
  120.                                    Var PortStat     : WORD     );
  121.  
  122. Function  VFosChkPortStat(             ComPort      : WORD;
  123.                                        Bit          : BYTE     ) : BOOLEAN;
  124.  
  125. Procedure VFosActivatePort(            ComPort      : WORD;
  126.                                    Var Sig          : WORD;
  127.                                    Var MaxFunc      : BYTE;
  128.                                    Var FosRev       : BYTE     );
  129.  
  130. Procedure VFosDeActivatePort(          ComPort      : WORD     );
  131.  
  132. Procedure VFosSetDTR(                  ComPort      : WORD;
  133.                                        OnOff        : BOOLEAN  );
  134.  
  135. Procedure VFosGetTimeTickInfo(     Var TickNo       : BYTE;
  136.                                    Var TickPSec     : BYTE;
  137.                                    Var MilPTick     : WORD     );
  138.  
  139. Procedure VFosFlushOutBuff(            ComPort      : WORD     );
  140.  
  141. Procedure VFosPurgeOutBuff(            ComPort      : WORD     );
  142.  
  143. Procedure VFosPurgeInBuff(             ComPort      : WORD     );
  144.  
  145. Procedure VFosSendChar(                ComPort      : WORD;
  146.                                        Ch           : CHAR;
  147.                                    Var BuffFull     : BOOLEAN  );
  148.  
  149. Procedure VFosPeekAhead(               ComPort      : WORD;
  150.                                    Var BuffEmpty    : BOOLEAN;
  151.                                    Var Ch           : CHAR     );
  152.  
  153. Procedure VFosKbRead(              Var ScanCode     : WORD     );
  154.  
  155. Procedure VFosKbReadW(             Var ScanCode     : WORD     );
  156.  
  157. Procedure VFosSetFlowControl(          ComPort      : WORD;
  158.                                        FlowStat     : BYTE     );
  159.  
  160. Procedure VFosControlCheck(            ComPort      : WORD;
  161.                                        CtrlStat     : BYTE;
  162.                                    Var CtrlRecv     : BOOLEAN  );
  163.  
  164. Procedure VFosSetCurLoc(               X            : BYTE;
  165.                                        Y            : BYTE     );
  166.  
  167. Procedure VFosGetCurLoc(           Var X            : BYTE;
  168.                                    Var Y            : BYTE     );
  169.  
  170. Procedure VFosWriteANSI(               Ch           : CHAR     );
  171.  
  172. Procedure VFosSetWatchDog(             ComPort      : WORD;
  173.                                        OnOff        : BOOLEAN  );
  174.  
  175. Procedure VFosWriteBIOS(               Ch           : CHAR     );
  176.  
  177. Procedure VFosReboot(                  WarmBoot     : BOOLEAN  );
  178.  
  179. Procedure VFosRecvBlock(               ComPort      : WORD;
  180.                                        Buf          : POINTER;
  181.                                        Count        : LONGINT;
  182.                                    Var Result       : LONGINT  );
  183.  
  184. Procedure VFosSendBlock(               ComPort      : WORD;
  185.                                        Buf          : POINTER;
  186.                                        Count        : LONGINT;
  187.                                    Var Result       : LONGINT  );
  188.  
  189. Procedure VFosSetBreak(                ComPort      : WORD;
  190.                                        OnOff        : BOOLEAN  );
  191.  
  192. Procedure VFosGetInfo(                 ComPort      : WORD;
  193.                                        Buf          : POINTER;
  194.                                        Count        : WORD;
  195.                                    Var Result       : WORD;
  196.                                    Var SigS         : ST4      );
  197.  
  198. Function  VFosGetFosStruct(            ComPort      : WORD;
  199.                                    Var FosStruct    : TFosStruct) : LONGINT;
  200.  
  201. Procedure VX00ActivatePort(            ComPort      : WORD;
  202.                                    Var Sig          : WORD;
  203.                                    Var MaxFunc      : BYTE;
  204.                                    Var FosRev       : BYTE     );
  205.  
  206. Procedure VX00DeActivatePort(          ComPort      : WORD     );
  207.  
  208. Procedure VX00SetExtLineCtrl(          ComPort      : WORD;
  209.                                        Break        : BOOLEAN;
  210.                                        ParityB      : BYTE;
  211.                                        StopBits     : BYTE;
  212.                                        DataBits     : BYTE;
  213.                                        BaudRateB    : BYTE;
  214.                                    Var PortStat     : WORD     );
  215.  
  216. Procedure VX00ExtGetMCR(               ComPort      : WORD;
  217.                                    Var MCRStat      : BYTE;
  218.                                    Var PortStat     : WORD     );
  219.  
  220. Procedure VX00ExtSetMCR(               ComPort      : WORD;
  221.                                        MCRStat      : BYTE;
  222.                                    Var PortStat     : WORD     );
  223.  
  224. Procedure VX00RecvCh(                  ComPort      : WORD;
  225.                                    Var Result       : BOOLEAN;
  226.                                    Var Ch           : CHAR     );
  227.  
  228. Procedure VX00StuffInBuff(             Ch           : CHAR     );
  229.  
  230. {────────────────────────────────────────────────────────────────────────────}
  231.  
  232. Procedure FosSerDriverProc(            SDP          : PSerDriverPacket );
  233.  
  234. {────────────────────────────────────────────────────────────────────────────}
  235.  
  236.